import request from '@/utils/request';

/**
 * 查询订单列表
 *
 * @param {object} query
 */
export const listOrder = (query: any) => {
	return request({
		url: '/rwmanage/form/list',
		method: 'get',
		params: query
	});
};

/**
 * 查询订单详细
 *
 * @param {string} id
 */
export const getOrder = (id: string) => {
	return request({
		url: '/rwmanage/form/' + id,
		method: 'get'
	});
};

/**
 * 新增订单
 *
 * @param {object} data
 */
export const addOrder = (data: any) => {
	return request({
		url: '/rwmanage/form/add',
		method: 'post',
		data: data
	});
};

/**
 *  修改订单
 *
 * @param {object} data
 */
export const updateOrder = (data: any) => {
	return request({
		url: '/rwmanage/form/edit',
		method: 'put',
		data: data
	});
};

/**
 * 删除订单
 *
 * @param {string} id
 */
export const delOrder = (id: string) => {
	return request({
		url: '/rwmanage/form/' + id,
		method: 'delete'
	});
};

/**
 * 导出订单
 *
 * @param {object} query
 */
export const exportOrder = (query: any) => {
	return request({
		url: '/rwmanage/form/export',
		method: 'get',
		params: query
	});
};

/**
 * 导出订单(返回流)
 *
 * @param {object} query
 */
export const exportOrder2 = (query: any) => {
	return request({
		url: '/rwmanage/form/exportByStream',
		method: 'post',
		data: query
	});
};
